package com.itheima.sh.pojo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description:
 * @Version: V1.0
 */
public class SpringTest {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
//        User user = applicationContext.getBean( User.class);
//        System.out.println(user);

//        UserFactory userFactory = new UserFactory();
//        UserFactory userFactory = applicationContext.getBean(UserFactory.class);
//        User user = userFactory.getUser();
//        System.out.println(user);


//        User user = UserFactory.getUser();
//        System.out.println(user);

        UserBeanFactory userBeanFactory = new UserBeanFactory();
        Object user = userBeanFactory.getBean("com.itheima.sh.pojo.User");
        System.out.println(user);


    }
}
